//
//  AXFServiceOnlineController.m
//  客服和反馈
//
//  Created by Freakthen on 2016/11/21.
//  Copyright © 2016年 Freakthen. All rights reserved.
//

#import "AXFServiceOnlineController.h"
#import "AXFTableViewCell.h"
#import "Masonry.h"
static NSString *cellID = @"cellID";
@interface AXFServiceOnlineController () <UITableViewDataSource,UITableViewDelegate>

@end

@implementation AXFServiceOnlineController

- (void)viewDidLoad {
    [super viewDidLoad];
}
- (void)setupUI
{
    UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
    [self.view addSubview:tableView];
    tableView.dataSource = self;
    tableView.delegate = self;
    [tableView registerClass:[AXFTableViewCell class] forCellReuseIdentifier:cellID];
    tableView.tableFooterView = [[UIView alloc] init];
    
    UILabel *timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(178, 4, self.view.bounds.size.width, 10)];
    timeLabel.text = @"今天 23:23";
    timeLabel.font = [UIFont systemFontOfSize:12];
    [tableView addSubview:timeLabel];
    
//    [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(self.topLayoutGuide).offset(8);
//        make.width.mas_equalTo(80);
//        make.height.mas_equalTo(10);
//        make.left.right.equalTo(self);
//    }];
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section == 0 ) {
        AXFTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath];
        cell.imageView.image = [UIImage imageNamed:@"icon"];
        cell.textLabel.text = @"您好，请问有什么可以帮助您？";
        cell.textLabel.font = [UIFont systemFontOfSize:13];

        return cell;
    }
    else
    {
        AXFTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath];
        cell.imageView.image = [UIImage imageNamed:@"icon"];
        cell.textLabel.text = @"您好亲～请问有什么可以帮助您的吗？";
        cell.textLabel.font = [UIFont systemFontOfSize:13];
        return cell;

    }
    }
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 20;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 5;
}
@end
